<template>
  <div>
    <div id="yjtitle">
      <mt-header title="意见反馈">
        <router-link to="/my" slot="left">
          <mt-button icon="back"></mt-button>
        </router-link>
      </mt-header>
    </div>
    <div class="liuyan">
      <textarea rows="5" placeholder="限300字（若有特殊需求，请联系商城在线客服)" maxlength="300" v-model="content"></textarea>
    </div>
    <div align="center">
      <mt-button style="width: 80% ;margin-top: 1rem" type="primary" @click="commit">提交</mt-button>
    </div>

  </div>
</template>

<script>
  import feedheader from "../../common/MyHeader";

  export default {
    name: "FeedBack",
    components: {
      feedheader
    },
    data(){
      return{
        content:""
      }

    },
    methods:{
      commit(){
        let postData = this.$qs.stringify({
          content: this.content,
        });
        //请求网络
        this.$axios.get(this.$apis.orders, postData
        ).then(res => {
          console.log(res);
          if (res.data.code === 1) {
            //成功
            this.$myUtils.bottomToast(this.content)
          } else {
            //弹错误提示
            this.$myUtils.bottomToast(res.data.msg)
          }
        })
          .catch(error => {
            this.$myUtils.bottomToast(error)
          })
      }
    }
  }
</script>

<style scoped>
  #yjtitle {
    height: 1.45rem;
  }


  .liuyan {
    width: 100%;
    margin: auto;
  }

  textarea {
    width: 90%;
    height: 5rem;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    padding: 0.15rem 0.2rem;
    margin: 0.3rem auto;
    display: block;
  }
</style>
